package com.disapand.strongarmy.service

import com.disapand.strongarmy.model.*
import com.disapand.strongarmy.vo.*
import com.disapand.strongarmy.vo.menu.*
import java.time.*

/**
 *
 * @auth disapand
 * @date 2021/11/5 - 20:36 - 星期五
 *
 */
interface MenuService {

    /**
     * 新增菜单
     *
     * @param name
     * @param path
     * @param icon
     * @param parentId
     * @param weight
     * @return
     */
    fun add(name: String, path: String?, icon: String?, parentId: Int, weight: Int): Boolean

    /**
     * 编辑菜单
     *
     * @param id
     * @param name
     * @param path
     * @param icon
     * @param parentId
     * @param weight
     * @return
     */
    fun edit(id: Int, name: String?, path: String?, icon: String?, parentId: Int?, weight: Int?): Boolean

    /**
     * 获取所有的菜单
     *
     * @return
     */
    fun get(): List<Menu>

    /**
     * 分页方式获取菜单
     *
     * @param name
     * @param path
     * @param parentId
     * @param status
     * @param createdBy
     * @param createdStartAt
     * @param createdEndAt
     * @param updatedBy
     * @param updatedStartAt
     * @param updatedEndAt
     * @param current
     * @param pageSize
     * @return
     */
    fun get(
        name: String?,
        path: String?,
        parentId: Int?,
        status: Int?,
        createdBy: Int?,
        createdStartAt: LocalDateTime?,
        createdEndAt: LocalDateTime?,
        updatedBy: Int?,
        updatedStartAt: LocalDateTime?,
        updatedEndAt: LocalDateTime?,
        current: Int,
        pageSize: Int
    ): PageVO<MenuPageVO>

    /**
     * 以 id 查询 menu
     *
     * @param id
     * @return
     */
    fun get(id: Int): Menu?

    /**
     * 以 name 查询 menu
     *
     * @param name
     * @return
     */
    fun get(name: String): List<Menu>

    /**
     * 删除 menu
     *
     * @param ids
     * @return
     */
    fun deleted(ids: IntArray): Boolean
}